Skip to main content

clickChar

Type

function

Summary

Returns the character the user last clicked in a field.

Syntax

the clickChar
clickChar()

Description

Use the clickChar function within a mouseDown, mouseUp, or selectionChanged handler to determine which character the user clicked, in order to provide hypertext (clickable text) or take some action based on the clicked character.

The clickChar function is cleared at the next mouse click, as well as after some editing actions such as deleting text. If the last click was not in a field, the clickChar function returns empty.

If the field is locked, the clickChar function is most useful within a handler (such as mouseDown or mouseUp) that is triggered by the mouse click.

If the field is unlocked, mouseDown and mouseUp messages are not sent when the user clicks in the field (unless the user right-clicks or holds down the Control key while clicking). Use the clickChar function within a selectionChanged handler to determine what characters the user is editing in an unlocked field.

To find the position of the clickChar, use the clickChunk function.

Examples

the clickChar
if the clickChar is not "*" then beep 2

function: clickCharChunk, mouseChar, charToNum, clickChunk, clickText

glossary: handler, unlock, message, trigger, return, hypertext

keyword: field, character, characters

message: mouseDown, mouseUp, selectionChanged

control structure: function

Compatibility and Support

Introduced

LiveCode 1.0

OS

mac

windows

linux

ios

android

Platforms

desktop

mobile

Thank you for your feedback!

Was this page helpful?